package net.sparrow.module;

import org.lwjgl.opengl.GL11;

import net.minecraft.src.RenderManager;
import net.sparrow.Sparrow;
import net.sparrow.cmd.CommandHandler;
import net.sparrow.event.DataField;
import net.sparrow.event.SpChestRenderEvent;
import net.sparrow.event.SpEventListener;
import net.sparrow.util.SpLocation;

public class ChestESPModule extends Module {

	
	
	@DataField(id = "esp.chest")
	public Boolean enabled = false;
	
	
	@SpEventListener
	public void onChestRender(SpChestRenderEvent e) {
		SpLocation loc = e.loc;
		if (enabled) {
			Sparrow.get().gui().draw().saveDrawContext();
			//Sparrow.get().gui().draw().resetTranslation();
			//GL11.glTranslated(Sparrow.mc().player().posX - RenderManager.renderPosX, Sparrow.mc().player().posY - RenderManager.renderPosY, Sparrow.mc().player().posZ - RenderManager.renderPosZ);
			//GL11.glTranslated(e.chest.xCoord, e.chest.yCoord, e.chest.zCoord);
			//GL11.glTranslated(loc.x, loc.y, loc.z);
			Sparrow.get().gui().draw().renderBoundingBox(loc.x + .5, loc.y + .5, loc.z + .5, .5, .5, .5);
			Sparrow.get().gui().draw().restoreDrawContext();
		}
	}
	
	
	public CommandHandler loadCommands() {
		return new CommandHandler().withDefaultToggle("esp.chest");
	}
}
